package com.framework.modules.dataview.dao;

import com.framework.modules.dataview.entity.StatUserDoingGroupForObject;
import com.framework.modules.dataview.entity.ViewUserDoingGroupForObjectListEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

/**
 * VIEW
 * 
 * @author MIT
 * @email litmiss@gmail.com
 * @date 2020-10-31 12:48:21
 */
public interface ViewUserDoingGroupForObjectListDao extends BaseMapper<ViewUserDoingGroupForObjectListEntity> {

    @Select("SELECT type,count(1) total FROM `view_user_doing_group_for_object_list` where uid=#{uid} and type='look' group by type")
    @MapKey("type")
    Map<String, StatUserDoingGroupForObject> stateMyAttentAndLikeAndLook(String uid);

    @Select("SELECT type,count(1) total FROM `view_user_doing_group_for_object_list` where object_id=#{uid} and type='look' group by type")
    @MapKey("type")
    Map<String, StatUserDoingGroupForObject> stateAttentAndLikeAndLookMe(String uid);
	
}
